<?php echo $header; ?>
<?php  echo $column_left; ?>
<?php  echo $column_right; ?>
<?php 
	$spanClass="span9";
	if( strlen(trim($column_left)) > 0  && strlen(trim($column_right)) > 0 ){
		$spanClass="span6";
	}else if(strlen(trim($column_left)) > 0  || strlen(trim($column_right)) > 0 ){
		$spanClass="span9";
	}else if(strlen(trim($column_left))== 0 && strlen(trim($column_right))== 0){
		$spanClass="span12";
	}else{
		$spanClass="span6";
	}
?>
<div class="<?php echo $spanClass;?>">
      
      <div id="content">
      	  
      	  <div class="breadcrumb">
            <?php foreach ($breadcrumbs as $breadcrumb) { ?>
            <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
            <?php } ?>
          </div> 
      	  
      	  <?php echo $content_top; ?>
      	  
          <h1><?php echo $heading_title; ?></h1>

             <!-- group -->
            <?php foreach ($categories as $category) { ?>
            	<div class="cat-int">
					<a href="<?php echo $category['href']; ?>"><img class="cat-img-int" src="<?php echo $category['image']; ?>" ></a>
	            	<h3><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></h3>
		              <?php if ($category['children']) { ?>
		              	<ul class="sub-list">
		                <?php for ($i = 0; $i < count($category['children']);) { ?>
		                  
		                  <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
		                  <?php for (; $i < $j; $i++) { ?>
		                  <?php if (isset($category['children'][$i])) { ?>
		                 		 <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
		                  <?php 
						  	} ?>
		                  <?php } ?>
		                <?php } ?>
		              </ul>
		              <?php } ?>
		          </div>
            <?php } ?>

          
      </div><!--/content-->

</div>
<?php echo $footer; ?>